#include <embios/kernel/Scheduler.h>
#include <xdc/runtime/System.h>

#include "package/internal/App.xdc.h"

Int App_main( Int argc, Char* argv[] )
{
    App_TimerMilli_start(1000, FALSE, Scheduler_toPostable(&module->event));
    Scheduler_start();

    return 0;
}

Void App_reactor( Ptr me, Scheduler_Signal sig )
{
    System_printf("reactor %d\n", module->count--);

    if (module->count > 0) {
        App_TimerMilli_start(1000, FALSE, Scheduler_toPostable(&module->event));
    }
    else {
        System_exit(0);
    }
}

